package ThreeDayMoreThread;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class ThreadPoolExample1 {
    public static void main(String[] args) {
        //1.创建一个固定大小的线程池
        ExecutorService executorService = Executors.newFixedThreadPool(20);
        //2.提交任务到线程池指向
        for (int i = 0; i < 10; i++) {
            executorService.execute(new Work());
        }
        //3.关闭线程池
     executorService.shutdown();
    }
}
